document.write('<script src="js/Jsclass.js" type="text/javascript" charset="utf-8"></script>');
var a=document.querySelectorAll('.leftmenu li');
function add(name){
		  for(var i=0;i<a.length;i++){
		  	 removeClass(a[i],'active');
		  	 console.log(a[i].getAttribute('name')+" "+name);
		  	 if(a[i].getAttribute('name')==name){
		  	 	  addClass(a[i],'active');
		  	 }
		  } 
}
function direct(str,obj){
	switch(str){
		case 'home':
		  window.location='Index.html#home';
		  break;
		case 'baocaihome':
		  window.location='IndexTest.html#baocaihome';
		  break;  
		  
		case 'productManage':
		  window.location='productManage.html#productManage';
		  break; 
		case 'planOrder':
		  window.location='#';
		  break; 
		case 'puhuo':
		  window.location='#';
		  break; 
		case 'yunying':
		window.location='yunyingCenter.html#yunying';
		  break; 
		 case 'dataCount':
		window.location='dataCount.html#dataCount';
		  break; 
		  case 'errorFinder':
		window.location='remoteScan.html#errorFinder';
		  break; 
		  case 'message':
		window.location='noticeCenter.html#message';
		  break; 
		  
		case 'account':
			window.location='accountSetting.html#account';
		    break; 
		case 'gonggao':
			window.location='gonggao.html#gonggao';
		    break;  
		 case 'qrcode':
			  window.location='codeManage_inside.html#qrcode';
		    break;
		 case 'menu':
			window.location='menuManage.html#menu';
		    break;  
		  case 'role':
			window.location='roleManage.html#role';
		    break;      
		   case 'area':
			window.location='areaWuliu.html#area';
		    break; 
		  case 'notice':
			window.location='noticeCenter.html#notice';
		    break;   
	    
	    case 'log':
	    window.location='log_access.html#log';
	    break;
	    
	    case 'company':
	    window.location='administratorBusiness.html#company';
	    break;
	}
	 
}
if(window.addEventListener){
	window.addEventListener('load',function(){
	setMenuActive();
  })
}else{
	window.attachEvent('onload',function(){
	setMenuActive();
  })
}


function setMenuActive(){
	 var url=window.location.href;
	 console.log(url.indexOf('#'));
	 if(url.indexOf('#')>-1){
	 	  var arr=url.split('#');
	 	  var tail=arr[1]?arr[1]:'';
	 	  if(tail){
	 	  	add(tail);
	 	  }
	 	  
	 }
}
